<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   构建你的独家TensorFlow模型  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://dataunion.org/23977.html",
                  host: "http://dataunion.org",
                  prePath: "http://dataunion.org",
                  scheme: "http",
                  pathBase: "http://dataunion.org/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466460846: Accept with keywords: (title(0.25):独家,模型,数盟,社区, topn(0.333333333333):社区,定义,数盟,合作伙伴,行业资讯,数据挖掘,图形,图书,联系,数据分析,Python,模型,职位,职业规划,例子,基础架构,文章,可视化,属性,函数,类别,链接,功能,编程语言,代码,重复使用,独家,人工智能,课程,行业).-->
 </head>
 <body onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    构建你的独家TensorFlow模型
   </h1>
  </div>
  <div class="container" id="xmain">
   ﻿﻿
   <title>
    构建你的独家TensorFlow模型 | 数盟社区
   </title>
   <!-- All in One SEO Pack 2.2.7.6.2 by Michael Torbert of Semper Fi Web Design[32,65] -->
   <!-- /all in one seo pack -->
   <!--
<div align="center">
<a href="http://strata.oreilly.com.cn/hadoop-big-data-cn?cmp=mp-data-confreg-home-stcn16_dataunion_pc" target="_blank"><img src="http://dataunion.org/wp-content/uploads/2016/05/stratabj.jpg"/ ></a>
</div>
-->
   <header id="header-web">
    <div class="header-main">
     <hgroup class="logo">
      <h1>
       <a href="http://dataunion.org/" rel="home" title="数盟社区">
        <img src="http://dataunion.org/wp-content/themes/yzipi/images/logo.png"/>
       </a>
      </h1>
     </hgroup>
     <!--logo-->
     <nav class="header-nav">
      <ul class="menu" id="menu-%e4%b8%bb%e8%8f%9c%e5%8d%95">
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-71" id="menu-item-71">
        <a href="http://dataunion.org/category/events" title="events">
         活动
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22457" id="menu-item-22457">
          <a href="http://dataunion.org/2016timeline">
           2016档期
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22459" id="menu-item-22459">
          <a href="http://dataunion.org/category/parterc">
           合作会议
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor menu-item-has-children menu-item-20869" id="menu-item-20869">
        <a href="http://dataunion.org/category/tech" title="articles">
         文章
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-20867" id="menu-item-20867">
          <a href="http://dataunion.org/category/tech/base" title="base">
           基础架构
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3302" id="menu-item-3302">
          <a href="http://dataunion.org/category/tech/ai" title="ai">
           人工智能
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3303" id="menu-item-3303">
          <a href="http://dataunion.org/category/tech/analysis" title="analysis">
           数据分析
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21920" id="menu-item-21920">
          <a href="http://dataunion.org/category/tech/dm">
           数据挖掘
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3314" id="menu-item-3314">
          <a href="http://dataunion.org/category/tech/viz" title="viz">
           可视化
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3305" id="menu-item-3305">
          <a href="http://dataunion.org/category/tech/devl" title="devl">
           编程语言
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-20876" id="menu-item-20876">
        <a href="http://dataunion.org/category/industry">
         行业
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-16328" id="menu-item-16328">
          <a href="http://dataunion.org/category/industry/case" title="case">
           行业应用
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-2112" id="menu-item-2112">
          <a href="http://dataunion.org/category/industry/demo" title="demo">
           Demo展示
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21562" id="menu-item-21562">
          <a href="http://dataunion.org/category/industry/news">
           行业资讯
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-311" id="menu-item-311">
        <a href="http://dataunion.org/category/sources" title="sources">
         资源
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20870" id="menu-item-20870">
        <a href="http://dataunion.org/category/books" title="book">
         图书
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21363" id="menu-item-21363">
        <a href="http://dataunion.org/category/training">
         课程
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-21853" id="menu-item-21853">
        <a href="http://dataunion.org/category/jobs">
         职位
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22050" id="menu-item-22050">
          <a href="http://dataunion.org/category/career">
           职业规划
          </a>
         </li>
        </ul>
       </li>
      </ul>
     </nav>
     <!--header-nav-->
    </div>
   </header>
   <!--header-web-->
   <div id="main">
    <div id="soutab">
     <form action="http://dataunion.org/" class="search" method="get">
     </form>
    </div>
    <div id="container">
     <nav id="mbx">
      当前位置：
      <a href="http://dataunion.org">
       首页
      </a>
      &gt;
      <a href="http://dataunion.org/category/tech">
       文章
      </a>
      &gt;
      <a href="http://dataunion.org/category/tech/base">
       基础架构
      </a>
      &gt;  正文
     </nav>
     <!--mbx-->
     <article class="content">
      <header align="centre" class="contenttitle">
       <div class="mscc">
        <h1 class="mscctitle">
         <a href="http://dataunion.org/23977.html">
          构建你的独家TensorFlow模型
         </a>
        </h1>
        <address class="msccaddress ">
         <em>
          1,287 次阅读 -
         </em>
         <a href="http://dataunion.org/category/tech/base" rel="category tag">
          基础架构
         </a>
        </address>
       </div>
      </header>
      <div class="content-text">
       <p>
        <strong>
         本文为数盟原创译文，转载时请注明出处为“数盟社区”。
        </strong>
       </p>
       <p>
        在TensorFlow上定义你的模型可以很容易建成一个巨大的代码墙。如何用一个具有可读性和可重复使用的方法来构建你的代码？对于你的inpacient，这里是一个到工作示例依据的链接。
       </p>
       <h2>
        定义计算图
       </h2>
       <p>
        为每个模型划分类别是合理的。类别的接口是什么？通常情况下，你的模型连接到一些输入数据和目标的占位符，并提供培训和考核操作。
       </p>
       <div class="highlighter-rouge">
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57686aad54d8e238362193" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           class Model:

    def __init__(self, data, target):
        data_size = int(data.get_shape()[1])
        target_size = int(target.get_shape()[1])
        weight = tf.Variable(tf.truncated_normal([data_size, target_size]))
        bias = tf.Variable(tf.constant(0.1, shape=[target_size]))
        incoming = tf.matmul(data, weight) + bias
        prediction = tf.nn.softmax(incoming)
        cross_entropy = -tf.reduce_sum(target, tf.log(prediction))
        self._optimize = tf.train.RMSPropOptimizer(0.03).minimize(cross_entropy)
        mistakes = tf.not_equal(tf.argmax(target, 1), tf.argmax(prediction, 1))
        self._error = tf.reduce_mean(tf.cast(mistakes, tf.float32))

    @property
    def optimize(self):
        return self._optimize

    @property
    def error(self):
        return self._error
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54d8e238362193-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54d8e238362193-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54d8e238362193-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54d8e238362193-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54d8e238362193-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54d8e238362193-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54d8e238362193-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-15">
                15
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54d8e238362193-16">
                16
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-17">
                17
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54d8e238362193-18">
                18
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-19">
                19
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54d8e238362193-20">
                20
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54d8e238362193-21">
                21
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-1">
                <span class="crayon-t">
                 class
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 Model
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54d8e238362193-2">
               </div>
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-3">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 __init__
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54d8e238362193-4">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 data_size
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 int
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 get_shape
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-5">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 target_size
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 int
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 get_shape
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54d8e238362193-6">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 weight
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 Variable
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 truncated_normal
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-v">
                 data_size
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 target_size
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-7">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 bias
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 Variable
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 constant
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 0.1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 shape
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-v">
                 target_size
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54d8e238362193-8">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 incoming
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 matmul
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 weight
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 +
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 bias
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-9">
                <span class="crayon-e">
                </span>
                <span class="crayon-v">
                 prediction
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 nn
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 softmax
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 incoming
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54d8e238362193-10">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 cross_entropy
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 -
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 reduce_sum
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 log
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 prediction
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-11">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _optimize
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 train
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 RMSPropOptimizer
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 0.03
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 minimize
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 cross_entropy
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54d8e238362193-12">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mistakes
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 not_equal
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 argmax
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 argmax
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 prediction
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-13">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _error
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 reduce_mean
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 cast
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 mistakes
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 float32
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54d8e238362193-14">
               </div>
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-15">
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 @
                </span>
                <span class="crayon-k ">
                 property
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54d8e238362193-16">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 optimize
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-17">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 _optimize
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54d8e238362193-18">
               </div>
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-19">
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 @
                </span>
                <span class="crayon-k ">
                 property
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54d8e238362193-20">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 error
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54d8e238362193-21">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _error
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0209 seconds] -->
        <br/>
        <p>
        </p>
       </div>
       <p>
        TensorFlow基本代码如何定义模型是十分基础的。但是，它也有一些问题。最值得注意的是，整个图形定义功能单一，即构造者。这既不是特别易读取也不可重复使用。
       </p>
       <h2>
        使用属性
       </h2>
       <p>
        单纯的代码分成功能并不能起作用，因为每个功能被调用时，该图形将被新的代码来扩展。因此，我们必须确保仅当功能第一次被调用时，该操作被添加到函数的曲线图。这基本上是延迟加载。
       </p>
       <p>
       </p>
       <div class="highlighter-rouge">
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57686aad54da0998735957" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           class Model:

    def __init__(self, data, target):
        self.data = data
        self.target = target
        self._prediction = None
        self._optimize = None
        self._error = None

    @property
    def prediction(self):
        if not self._prediction:
            data_size = int(self.data.get_shape()[1])
            target_size = int(self.target.get_shape()[1])
            weight = tf.Variable(tf.truncated_normal([data_size, target_size]))
            bias = tf.Variable(tf.constant(0.1, shape=[target_size]))
            incoming = tf.matmul(self.data, weight) + bias
            self._prediction = tf.nn.softmax(incoming)
        return self._prediction

    @property
    def optimize(self):
        if not self._optimize:
            cross_entropy = -tf.reduce_sum(self.target, tf.log(self.prediction))
            optimizer = tf.train.RMSPropOptimizer(0.03)
            self._optimize = optimizer.minimize(cross_entropy)
        return self._optimize

    @property
    def error(self):
        if not self._error:
            mistakes = tf.not_equal(
                tf.argmax(self.target, 1), tf.argmax(self.prediction, 1))
            self._error = tf.reduce_mean(tf.cast(mistakes, tf.float32))
        return self._error
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-15">
                15
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-16">
                16
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-17">
                17
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-18">
                18
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-19">
                19
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-20">
                20
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-21">
                21
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-22">
                22
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-23">
                23
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-24">
                24
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-25">
                25
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-26">
                26
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-27">
                27
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-28">
                28
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-29">
                29
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-30">
                30
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-31">
                31
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-32">
                32
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-33">
                33
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54da0998735957-34">
                34
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54da0998735957-35">
                35
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-57686aad54da0998735957-1">
                <span class="crayon-t">
                 class
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 Model
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-2">
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-3">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 __init__
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-4">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 data
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-5">
                <span class="crayon-e">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 target
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-6">
                <span class="crayon-e">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _prediction
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-t">
                 None
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-7">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _optimize
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-t">
                 None
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-8">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _error
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-t">
                 None
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-9">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-10">
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 @
                </span>
                <span class="crayon-k ">
                 property
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-11">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 prediction
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-12">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 if
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 not
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _prediction
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-13">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 data_size
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 int
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 get_shape
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-14">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 target_size
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 int
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 get_shape
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-15">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 weight
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 Variable
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 truncated_normal
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-v">
                 data_size
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 target_size
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-16">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 bias
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 Variable
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 constant
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 0.1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 shape
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-v">
                 target_size
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-17">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 incoming
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 matmul
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 weight
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 +
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 bias
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-18">
                <span class="crayon-e">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _prediction
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 nn
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 softmax
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 incoming
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-19">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 _prediction
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-20">
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-21">
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 @
                </span>
                <span class="crayon-k ">
                 property
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-22">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 optimize
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-23">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 if
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 not
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _optimize
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-24">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 cross_entropy
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 -
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 reduce_sum
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 log
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 prediction
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-25">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 optimizer
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 train
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 RMSPropOptimizer
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 0.03
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-26">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _optimize
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 optimizer
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 minimize
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 cross_entropy
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-27">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 _optimize
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-28">
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-29">
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 @
                </span>
                <span class="crayon-k ">
                 property
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-30">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 error
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-31">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 if
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 not
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _error
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-32">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mistakes
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 not_equal
                </span>
                <span class="crayon-sy">
                 (
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-33">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 argmax
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 argmax
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 prediction
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54da0998735957-34">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _error
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 reduce_mean
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 cast
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 mistakes
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 float32
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54da0998735957-35">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 _error
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0319 seconds] -->
        <br/>
        <p>
        </p>
       </div>
       <p>
        这肯定比第一个例子更好。现在你的代码结构为，你可以专注于各自的功能。但是，由于延迟加载逻辑，代码还是有点迟缓。让我们看看如何改善这一点。
       </p>
       <h2>
        延迟属性构建
       </h2>
       <p>
        Python是一种非常灵活的语言。让我来告诉你如何从刚才的例子中剔除冗余代码。我们将使用一个像@property这样只有一次评估函数的构建者。它将结果存储在一个用成员名字命名的构建功能下（用下划线前缀），并在后续任何调用时返回该值。如果你还没有使用自定义构建，你可能也想看看这个指南。
       </p>
       <div class="highlighter-rouge">
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57686aad54daa601095162" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           import functools


def lazy_property(function):
    attribute = '_' + function.__name__

    @property
    @functools.wraps(function)
    def wrapper(self):
        if not hasattr(self, attribute):
            setattr(self, attribute, function(self))
        return getattr(self, attribute)
    return wrapper
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-57686aad54daa601095162-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54daa601095162-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54daa601095162-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54daa601095162-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54daa601095162-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54daa601095162-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54daa601095162-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54daa601095162-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54daa601095162-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54daa601095162-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54daa601095162-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54daa601095162-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54daa601095162-13">
                13
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-57686aad54daa601095162-1">
                <span class="crayon-r">
                 import
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 functools
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54daa601095162-2">
               </div>
               <div class="crayon-line" id="crayon-57686aad54daa601095162-3">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54daa601095162-4">
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 lazy_property
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 function
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54daa601095162-5">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 attribute
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-s">
                 '_'
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 +
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 function
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 __name_
                </span>
                <span class="crayon-sy">
                 _
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54daa601095162-6">
               </div>
               <div class="crayon-line" id="crayon-57686aad54daa601095162-7">
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 @
                </span>
                <span class="crayon-k ">
                 property
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54daa601095162-8">
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 @
                </span>
                <span class="crayon-k ">
                 functools
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 wraps
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 function
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54daa601095162-9">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 wrapper
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54daa601095162-10">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 if
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 not
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 hasattr
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 attribute
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54daa601095162-11">
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 setattr
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 attribute
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 function
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54daa601095162-12">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 getattr
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 attribute
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54daa601095162-13">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 wrapper
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0039 seconds] -->
        <br/>
        <p>
        </p>
       </div>
       <p>
        使用这个构建后，我们的例子简化成下面的代码。
       </p>
       <div class="highlighter-rouge">
        <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
        <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-57686aad54db1799169993" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
         <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <span class="crayon-title">
          </span>
          <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
           <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-wrap-button" title="切换自动换行">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-expand-button" title="点击展开代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-copy-button" title="复制代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
            <div class="crayon-button-icon">
            </div>
           </div>
           <span class="crayon-language">
            Python
           </span>
          </div>
         </div>
         <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
         </div>
         <div class="crayon-plain-wrap">
          <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
           class Model:

    def __init__(self, data, target):
        self.data = data
        self.target = target
        self.prediction
        self.optimize
        self.error

    @lazy_property
    def prediction(self):
        data_size = int(self.data.get_shape()[1])
        target_size = int(self.target.get_shape()[1])
        weight = tf.Variable(tf.truncated_normal([data_size, target_size]))
        bias = tf.Variable(tf.constant(0.1, shape=[target_size]))
        incoming = tf.matmul(self.data, weight) + bias
        return tf.nn.softmax(incoming)

    @lazy_property
    def optimize(self):
        cross_entropy = -tf.reduce_sum(self.target, tf.log(self.prediction))
        optimizer = tf.train.RMSPropOptimizer(0.03)
        return optimizer.minimize(cross_entropy)

    @lazy_property
    def error(self):
        mistakes = tf.not_equal(
            tf.argmax(self.target, 1), tf.argmax(self.prediction, 1))
        return tf.reduce_mean(tf.cast(mistakes, tf.float32))
          </textarea>
         </div>
         <div class="crayon-main" style="">
          <table class="crayon-table">
           <tbody>
            <tr class="crayon-row">
             <td class="crayon-nums " data-settings="show">
              <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-1">
                1
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-2">
                2
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-3">
                3
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-4">
                4
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-5">
                5
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-6">
                6
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-7">
                7
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-8">
                8
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-9">
                9
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-10">
                10
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-11">
                11
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-12">
                12
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-13">
                13
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-14">
                14
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-15">
                15
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-16">
                16
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-17">
                17
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-18">
                18
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-19">
                19
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-20">
                20
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-21">
                21
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-22">
                22
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-23">
                23
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-24">
                24
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-25">
                25
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-26">
                26
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-27">
                27
               </div>
               <div class="crayon-num crayon-striped-num" data-line="crayon-57686aad54db1799169993-28">
                28
               </div>
               <div class="crayon-num" data-line="crayon-57686aad54db1799169993-29">
                29
               </div>
              </div>
             </td>
             <td class="crayon-code">
              <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
               <div class="crayon-line" id="crayon-57686aad54db1799169993-1">
                <span class="crayon-t">
                 class
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 Model
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-2">
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-3">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 __init__
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-4">
                <span class="crayon-h">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 data
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-5">
                <span class="crayon-e">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 target
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-6">
                <span class="crayon-e">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 prediction
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-7">
                <span class="crayon-e">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 optimize
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-8">
                <span class="crayon-e">
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-i">
                 error
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-9">
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-10">
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 @
                </span>
                <span class="crayon-e">
                 lazy_property
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-11">
                <span class="crayon-e">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 prediction
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-12">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 data_size
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 int
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 get_shape
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-13">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 target_size
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-k ">
                 int
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 get_shape
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-14">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 weight
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 Variable
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 truncated_normal
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-v">
                 data_size
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 target_size
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-15">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 bias
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 Variable
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 constant
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 0.1
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 shape
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-sy">
                 [
                </span>
                <span class="crayon-v">
                 target_size
                </span>
                <span class="crayon-sy">
                 ]
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-16">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 incoming
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 matmul
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 data
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 weight
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 +
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 bias
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-17">
                <span class="crayon-e">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 nn
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 softmax
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 incoming
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-18">
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-19">
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 @
                </span>
                <span class="crayon-e">
                 lazy_property
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-20">
                <span class="crayon-e">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 optimize
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-21">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 cross_entropy
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 -
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 reduce_sum
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 log
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 prediction
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-22">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 optimizer
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 train
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 RMSPropOptimizer
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-cn">
                 0.03
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-23">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 optimizer
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 minimize
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 cross_entropy
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-24">
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-25">
                <span class="crayon-h">
                </span>
                <span class="crayon-sy">
                 @
                </span>
                <span class="crayon-e">
                 lazy_property
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-26">
                <span class="crayon-e">
                </span>
                <span class="crayon-r">
                 def
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-e">
                 error
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-o">
                 :
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-27">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 mistakes
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-o">
                 =
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 not_equal
                </span>
                <span class="crayon-sy">
                 (
                </span>
               </div>
               <div class="crayon-line crayon-striped-line" id="crayon-57686aad54db1799169993-28">
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 argmax
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 target
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 argmax
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-r">
                 self
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 prediction
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-cn">
                 1
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
               <div class="crayon-line" id="crayon-57686aad54db1799169993-29">
                <span class="crayon-h">
                </span>
                <span class="crayon-st">
                 return
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 reduce_mean
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-e">
                 cast
                </span>
                <span class="crayon-sy">
                 (
                </span>
                <span class="crayon-v">
                 mistakes
                </span>
                <span class="crayon-sy">
                 ,
                </span>
                <span class="crayon-h">
                </span>
                <span class="crayon-v">
                 tf
                </span>
                <span class="crayon-sy">
                 .
                </span>
                <span class="crayon-v">
                 float32
                </span>
                <span class="crayon-sy">
                 )
                </span>
                <span class="crayon-sy">
                 )
                </span>
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <!-- [Format Time: 0.0515 seconds] -->
        <br/>
        <p>
        </p>
       </div>
       <p>
        请注意，我们提到在构造函数中的属性。这种方式要确保是当我们运行tf.initialize_variables()的时候完整图形被定义。
       </p>
       <p>
        现在，我们可以用结构化的和紧凑的方式定义模型。这很适合我。如果您有任何建议或疑问，可以随意使用注释部分。
       </p>
       <p>
        原文链接：https://danijar.github.io/structuring-your-tensorflow-models
       </p>
      </div>
      <div>
       <strong>
        注：转载文章均来自于公开网络，仅供学习使用，不会用于任何商业用途，如果侵犯到原作者的权益，请您与我们联系删除或者授权事宜，联系邮箱：contact@dataunion.org。转载数盟网站文章请注明原文章作者，否则产生的任何版权纠纷与数盟无关。
       </strong>
      </div>
      <!--content_text-->
      <div class="fenxian">
       <!-- JiaThis Button BEGIN -->
       <div class="jiathis_style_32x32">
        <p class="jiathis_button_weixin">
        </p>
        <p class="jiathis_button_tsina">
        </p>
        <p class="jiathis_button_qzone">
        </p>
        <p class="jiathis_button_cqq">
        </p>
        <p class="jiathis_button_tumblr">
        </p>
        <a class="jiathis jiathis_txt jtico jtico_jiathis" href="http://www.jiathis.com/share" target="_blank">
        </a>
        <p class="jiathis_counter_style">
        </p>
       </div>
       <!-- JiaThis Button END -->
      </div>
     </article>
     <!--content-->
     <!--相关文章-->
     <div class="xianguan">
      <div class="xianguantitle">
       相关文章！
      </div>
      <ul class="pic">
       <li>
        <a href="http://dataunion.org/24670.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/03/20141222134630106-300x164.png"/>
        </a>
        <a class="link" href="http://dataunion.org/24670.html" rel="bookmark" title="Apache Spark 不过时的六大理由">
         Apache Spark 不过时的六大理由
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/24558.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/06/wKiom1dcvqDBYzojAAF3j3hfL_s877.jpg-wh_651x-s_1673119543-300x197.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/24558.html" rel="bookmark" title="实现R与Hadoop联合作业的三种方法">
         实现R与Hadoop联合作业的三种方法
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/24454.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/06/234040u557x77z325w2g3o-267x200.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/24454.html" rel="bookmark" title="LinkedIn 开源其分布式对象存储系统 Ambry">
         LinkedIn 开源其分布式对象存储系统 Ambry
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/24349.html">
         <img src="http://dataunion.org/wp-content/uploads/2016/05/20150402110749389-249x200.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/24349.html" rel="bookmark" title="生活处处皆学问，我从星巴克咖啡学到的5点架构经验">
         生活处处皆学问，我从星巴克咖啡学到的5点架构经验
        </a>
       </li>
      </ul>
     </div>
     <!--相关文章-->
     <div class="comment" id="comments">
      <!-- You can start editing here. -->
      <!-- If comments are open, but there are no comments. -->
      <div class="title">
       期待你一针见血的评论，Come on！
      </div>
      <div id="respond">
       <p>
        不用想啦，马上
        <a href="http://dataunion.org/wp-login.php?redirect_to=http%3A%2F%2Fdataunion.org%2F23977.html">
         "登录"
        </a>
        发表自已的想法.
       </p>
      </div>
     </div>
     <!-- .nav-single -->
    </div>
    <!--Container End-->
    <aside id="sitebar">
     <div class="sitebar_list2">
      <div class="wptag">
       <span class="tagtitle">
        热门标签+
       </span>
       <div class="tagg">
        <ul class="menu" id="menu-%e5%8f%8b%e6%83%85%e9%93%be%e6%8e%a5">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-1605" id="menu-item-1605">
          <a href="http://taidizh.com/">
           泰迪智慧
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-20884" id="menu-item-20884">
          <a href="http://www.transwarp.cn/">
           星环科技
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-3538" id="menu-item-3538">
          <a href="http://datall.org/">
           珈和遥感
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-20888" id="menu-item-20888">
          <a href="http://www.chinahadoop.cn/">
           小象学院
          </a>
         </li>
        </ul>
       </div>
      </div>
     </div>
     <div class="sitebar_list">
      <div class="textwidget">
       <div align="center">
        <a href="http://study.163.com/course/courseMain.htm?courseId=991022" target="_blank">
         <img src="http://dataunion.org/wp-content/uploads/2016/03/dv.jpg"/>
        </a>
       </div>
      </div>
     </div>
     <div class="sitebar_list">
      <h4 class="sitebar_title">
       文章分类
      </h4>
      <div class="tagcloud">
       <a class="tag-link-44" href="http://dataunion.org/category/industry/demo" style="font-size: 10.204724409449pt;" title="4个话题">
        Demo展示
       </a>
       <a class="tag-link-31" href="http://dataunion.org/category/experts" style="font-size: 15.826771653543pt;" title="52个话题">
        专家团队
       </a>
       <a class="tag-link-870" href="http://dataunion.org/category/tech/ai" style="font-size: 19.795275590551pt;" title="273个话题">
        人工智能
       </a>
       <a class="tag-link-488" href="http://dataunion.org/category/%e5%8a%a0%e5%85%a5%e6%95%b0%e7%9b%9f" style="font-size: 8pt;" title="1个话题">
        加入数盟
       </a>
       <a class="tag-link-869" href="http://dataunion.org/category/tech/viz" style="font-size: 17.204724409449pt;" title="93个话题">
        可视化
       </a>
       <a class="tag-link-30" href="http://dataunion.org/category/partners" style="font-size: 10.645669291339pt;" title="5个话题">
        合作伙伴
       </a>
       <a class="tag-link-889" href="http://dataunion.org/category/parterc" style="font-size: 11.582677165354pt;" title="8个话题">
        合作会议
       </a>
       <a class="tag-link-104" href="http://dataunion.org/category/books" style="font-size: 12.96062992126pt;" title="15个话题">
        图书
       </a>
       <a class="tag-link-220" href="http://dataunion.org/category/tech/base" style="font-size: 19.850393700787pt;" title="281个话题">
        基础架构
       </a>
       <a class="tag-link-219" href="http://dataunion.org/category/tech/analysis" style="font-size: 19.409448818898pt;" title="232个话题">
        数据分析
       </a>
       <a class="tag-link-887" href="http://dataunion.org/category/tech/dm" style="font-size: 13.291338582677pt;" title="17个话题">
        数据挖掘
       </a>
       <a class="tag-link-34" href="http://dataunion.org/category/tech" style="font-size: 20.732283464567pt;" title="404个话题">
        文章
       </a>
       <a class="tag-link-1" href="http://dataunion.org/category/uncategorized" style="font-size: 22pt;" title="693个话题">
        未分类
       </a>
       <a class="tag-link-4" href="http://dataunion.org/category/events" style="font-size: 14.503937007874pt;" title="29个话题">
        活动
       </a>
       <a class="tag-link-890" href="http://dataunion.org/category/tech/%e6%b7%b1%e5%ba%a6%e5%ad%a6%e4%b9%a0" style="font-size: 10.204724409449pt;" title="4个话题">
        深度学习
       </a>
       <a class="tag-link-221" href="http://dataunion.org/category/tech/devl" style="font-size: 18.968503937008pt;" title="193个话题">
        编程语言
       </a>
       <a class="tag-link-888" href="http://dataunion.org/category/career" style="font-size: 15.661417322835pt;" title="48个话题">
        职业规划
       </a>
       <a class="tag-link-5" href="http://dataunion.org/category/jobs" style="font-size: 14.11811023622pt;" title="25个话题">
        职位
       </a>
       <a class="tag-link-871" href="http://dataunion.org/category/industry" style="font-size: 15.716535433071pt;" title="49个话题">
        行业
       </a>
       <a class="tag-link-613" href="http://dataunion.org/category/industry/case" style="font-size: 16.984251968504pt;" title="84个话题">
        行业应用
       </a>
       <a class="tag-link-885" href="http://dataunion.org/category/industry/news" style="font-size: 17.425196850394pt;" title="102个话题">
        行业资讯
       </a>
       <a class="tag-link-10" href="http://dataunion.org/category/training" style="font-size: 14.228346456693pt;" title="26个话题">
        课程
       </a>
       <a class="tag-link-16" href="http://dataunion.org/category/sources" style="font-size: 15.661417322835pt;" title="48个话题">
        资源
       </a>
      </div>
     </div>
     <div class="sitebar_list">
      <h4 class="sitebar_title">
       功能
      </h4>
      <ul>
       <li>
        <a href="http://dataunion.org/wp-login.php?action=register">
         注册
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/wp-login.php">
         登录
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/feed">
         文章
         <abbr title="Really Simple Syndication">
          RSS
         </abbr>
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/comments/feed">
         评论
         <abbr title="Really Simple Syndication">
          RSS
         </abbr>
        </a>
       </li>
       <li>
        <a href="https://cn.wordpress.org/" title="基于WordPress，一个优美、先进的个人信息发布平台。">
         WordPress.org
        </a>
       </li>
      </ul>
     </div>
    </aside>
    <div class="clear">
    </div>
   </div>
   <!--main-->
   ﻿
   <footer id="dibu">
    <div class="about">
     <div class="right">
      <ul class="menu" id="menu-%e5%ba%95%e9%83%a8%e8%8f%9c%e5%8d%95">
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-18024" id="menu-item-18024">
        <a href="http://dataunion.org/category/partners">
         合作伙伴
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20881" id="menu-item-20881">
        <a href="http://dataunion.org/contribute">
         文章投稿
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20872" id="menu-item-20872">
        <a href="http://dataunion.org/category/%e5%8a%a0%e5%85%a5%e6%95%b0%e7%9b%9f">
         加入数盟
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22441" id="menu-item-22441">
        <a href="http://dataunion.org/f-links">
         友情链接
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20874" id="menu-item-20874">
        <a href="http://dataunion.org/aboutus">
         关于数盟
        </a>
       </li>
      </ul>
      <p class="banquan">
       数盟社区        ，
        做最棒的数据科学社区
      </p>
     </div>
     <div class="left">
      <ul class="bottomlist">
       <li>
        <a href="http://weibo.com/DataScientistUnion  " target="_blank" 　title="">
         <img src="http://dataunion.org/wp-content/themes/yzipi/images/weibo.png"/>
        </a>
       </li>
       <li>
        <a class="cd-popup-trigger" href="http://dataunion.org/23977.html#0">
         <img src="http://dataunion.org/wp-content/themes/yzipi/images/weixin.png"/>
        </a>
       </li>
      </ul>
      <div class="cd-popup">
       <div class="cd-popup-container">
        <h1>
         扫描二维码,加微信公众号
        </h1>
        <img src="http://dataunion.org/wp-content/themes/yzipi/images/2014-12-06-1515289049.png"/>
        <a class="cd-popup-close" href="http://dataunion.org/23977.html">
        </a>
       </div>
       <!-- cd-popup-container -->
      </div>
      <!-- cd-popup -->
     </div>
    </div>
    <!--about-->
    <div class="bottom">
     <a href="http://dataunion.org/">
      数盟社区
     </a>
     <a href="http://www.miitbeian.gov.cn/" rel="external nofollow" target="_blank">
      京ICP备14026740号
     </a>
     联系我们：
     <a href="mailto:contact@dataunion.org" target="_blank">
      contact@dataunion.org
     </a>
     <div class="tongji">
     </div>
     <!--bottom-->
     <div class="scroll" id="scroll" style="display:none;">
      ︿
     </div>
    </div>
   </footer>
   <!--dibu-->
  </div>
 </body>
</html>